package com.fay.designPattern.reflector;

import java.util.Date;

/**
 * @Title:
 * @Description:
 * @Author Fay Wang
 * @Date 2022/3/24 22:40
 * @Version 1.0
 */
public class PreDemo {
    public long calculateDelayDays(Date dueTime) {
        long currentTimestamp = System.currentTimeMillis();
        if (dueTime.getTime() >= currentTimestamp) {
            return 0;
        }
        long delayTime = currentTimestamp - dueTime.getTime();
        long delayDays = delayTime / 86400;
        return delayDays;
    }

    public boolean isAfterNow(Date dueTime) {
        long currentTimestamp = System.currentTimeMillis();
        return dueTime.getTime() >= currentTimestamp;
    }

    public long calculateDelayDays1(Date dueTime) {
        long currentTimestamp = System.currentTimeMillis();
        if (dueTime.getTime() >= currentTimestamp) {
            return 0;
        }
        long delayTime = currentTimestamp - dueTime.getTime();
        long delayDays = delayTime / 86400;
        return delayDays;
    }


}
